package file;

import java.io.File;

public class MakeDirDemo
{
    public static void main(String[] args)
    {
        File dir = new File("./demo");
        if (dir.exists())
        {
            System.out.println("dir is exists" );
        }
        else
        {
            dir.mkdir();  // 创建单层目录
            System.out.println("dir is created");
        }


        File dirs = new File("a/b/c/e");
        if (dirs.exists())
        {
            System.out.println("dirs has existed");
        }
        else
        {
            dirs.mkdirs();  // 创建多层目录
        }
    }
}
